1. Field of the Invention
This invention relates to an image processing method and apparatus for performing a quantization processing of image data, and more particularly, to an image processing method and apparatus for reproducing a half-tone image.
2. Description of the Prior Art
Heretofore, there has been known an error diffusion method for use as an image processing method for reproducing a half-tone image by, for example, a binary image reproducing, in a digital copier, digital facsimile and the like.
In this method, a difference in density, for every picture element, between the density of an image of an original document and the density of the corresponding picture element of the binary-coded output image, that is, an error, is determined, and the value of the error so determined is dispersed, after performing a specific weighting to picture elements surrounding the picture element in question in accordance with coefficients of a weighting matrix.
Since this method spatially clears an error which is a difference in density between an image of an original document and an output image, there is no limitation on the number of gradations due to the size of a matrix as in a dither processing (which is another binary-coding method), and it is possible to perform a threshold processing which depends on the value of a picture element.
Accordingly, the error diffusion method makes possible compatibility of gradation and resolution, which is a problem in dither processing.
The error diffusion method has been presented in R. W. Floyd and L. Steinberg, "An Adaptive Algorithm for Spatial Gray Scale", SID75 Digest (1976).
The expression of the error diffusion method is as follows. In the following expression, input data are assumed to be of 6 bits; EQU D.sub.i,j =X.sub.i,j +(.SIGMA..SIGMA..alpha..sub.i+m,j+n.E.sub.i+m,j+n)(1/Z.alpha..sub.m,n) EQU Y.sub.i,j =63(D.sub.i,j .gtoreq.T) EQU Y.sub.i,j =0(D.sub.i,j &lt;T),
where
D.sub.i,j : the density of the picture element (i,j) in question after correction PA1 X.sub.i,j : the density of an input image of the picture element (i,j) in question PA1 E.sub.i,j : the error when the picture element (i,j) in question is binary-coded PA1 .alpha..sub.i,j : weighting cofficient PA1 Y.sub.i,j : the density of an output image PA1 T: threshold value.
That is, in the above expression, weighted (by multiplying .alpha..sub.i+m,j+n and dividing by .SIGMA..alpha..sub.m,n) values of errors E.sub.i+m,j+n generated at surrounding picture elements are added to the density X.sub.i,j of an input image of the picture element in question, and the resultant value becomes the density D.sub.i,j of the picture element in question after error correction. The density Y.sub.i,j of an output image is obtained by binary-coding the D.sub.i,j using a threshold value T (for example, T=32).
A printer performs an on/off control of a dot (i.e., prints a dot or not) in accordance with the value of the Y.sub.i,j to perform image formation.
However, when highlight portions of an image are binary-coded by the error diffusion method, there is the disadvantage that grain-like noises are generated in the highlight portions of the image. In order to remove this disadvantage, the assignee of the present invention has filed Ser. No. 289,017.
The error diffusion method also has the disadvantage that a unique texture (a striped pattern) appears in high-light and half-tone portions of an image. This is caused by dots of binary outputs connected in a line.
Now, the cause of such generation of the texture will be investigated. As described above, in the error diffusion method, an error generated in a picture element in question is weighted using a weighting matrix and diffused to surrounding picture elements.
For example, a weighting matrix .alpha..sub.i,j (X,1), that is, for a case in which an error generated at a picture element X in question is dispersed to an adjacent picture element to the right, will be investigated.
Since there is a higher probability of an output image being 0 in highlight and half-tone portions of an image compared with dark portions, a positive error is generated in many cases. A positive error is generated when an output image is made 0, since input image data have at least a certain degree of density.
When the positive error is dispersed to an adjacent picture element to the right with the above-described weighing matrix .alpha..sub.i,j (X,1), the probability of a dot being "on" at the dispersed picture element (the adjacent picture element) becomes high. When processing for one line of input image data is completed and the processing is shifted to the next line, the positive error is also dispersed to a picture element which corresponds to that in the preceding line (a picture element under that in the preceding line), and the probability of the dot of this picture element being "on" also becomes high.
That is, the probability of dots being "on" becomes high periodically in the subscanning direction, and a striped pattern is generated due to connection of these dots. An appearance of the generation of a striped pattern in the subscanning direction is shown in FIG. 25.
According to the shape of the weighting matrix, dots may also be connected in the main scanning direction or in an oblique direction, and a striped pattern is generated.
As described above, although, in the conventional error diffusion method, resolution is excellent compared with dither processing, a unique texture (this striped pattern) is generated in highlight and half-tone portions of an image, and it is impossible to reproduce an excellent image.
Now, in the error diffusion method, the processing for determining values to be distributed to surrounding picture elements from the error generated at a picture element in question will be investigated.
The error generated when the density X.sub.i,j of an input image of a picture element (i,j) in question is binary-coded is represented by E.sub.i,j, and the weighting matrix .alpha..sub.i,j is represented by ##EQU1## X: a picture element in question.
In order to determine distribution values, first the error E.sub.i,j is divided by the sum 10 of numbers which make up the weighting matrix .alpha..sub.i,j, and values in which each coefficient of .alpha..sub.i,j is multiplied by that sum become distribution values of the E.sub.i,j to surrounding picture elements.
For example, if E.sub.i,j =25, the values become
______________________________________ to picture element (i + 1, j) 4*Int(25*1/10) = 8 to picture element (i - 1, j) 1*Int(25*1/10) = 2 to picture element (i, j + 1) 4*Int(25*1/10) = 8 to picture element (i + 1, j + 1) 1*Int(25*1/10) = 2. ______________________________________
In this example, the configuration is provided by hardware, and is designed to truncate values to the right of the decimal point for the sake of simplification.
When the above-calculated distribution values are added, the result is EQU E*.sub.i,j =8+2+8+2=20.
This value is different from E.sub.i,j =25.
The difference (E.sub.i,j -E*.sub.i,j) is caused by neglecting the remainder when the error is divided by 10.
In the case of the error diffusion method, if there is a difference between the error generated at a picture element in question and the error diffused to surroundings, the density of an input image is not preserved. Hence, it results that the density of an input image does not equal the density of an output image, and the picture quality of the outout image deteriorates.
When a decimal-point operation (it is necessary to execute a decimal-point operation of at least two digits in order to prevent the deterioration of an image) is used in order to solve the above-described problems, circuit scale becomes very large, and so this approach is not an effective method.
As described above, the conventional error diffusion method has the disadvantage that, if an error due to a remainder or surplus which is generated when an error is weighed is neglected, density is not preserved, and picture quality deteriorates.
There is also the disadvantage that, if it is tried to suppress the influence of the remainder by performing a decimal-point operation, circuit scale becomes very large.